package com.greydawn.AbstractFactoryPattern;

/**
 * @Author: zhongwr
 * @Create: 2021/12/6 23:11
 * @Version 1.0
 * @Description: 工厂生产者
 */
public class FactoryProducer {

    public static AbstractFactory getFactory(String name) {
        if ("shape".equalsIgnoreCase(name)) {
            return new ShapeFactory();
        }
        if ("color".equalsIgnoreCase(name)) {
            return new ColorFactory();
        }
        return null;
    }
}
